-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Accumulate compute() calls and iterations between convergences in DesiredBalanceComputer
#126008
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Pinging @elastic/es-distributed-coordination (Team:Distributed Coordination) |
Hi @JeremyDahlgren, I've created a changelog YAML for you. |
881da5b
to
aeb8946
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good stuff, I left some comments
...main/java/org/elasticsearch/cluster/routing/allocation/allocator/DesiredBalanceComputer.java
Outdated
Show resolved
Hide resolved
...main/java/org/elasticsearch/cluster/routing/allocation/allocator/DesiredBalanceComputer.java
Outdated
Show resolved
Hide resolved
...main/java/org/elasticsearch/cluster/routing/allocation/allocator/DesiredBalanceComputer.java
Outdated
Show resolved
Hide resolved
"Desired balance computation for [{}] converged after [{}] and [{}] iterations, " | ||
+ "[{}] compute() calls with [{}] total iterations since last convergence [{}] ago", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional nit, I'd use a multi-line string here, they're slightly easier to read and less hassle to modify in future:
"Desired balance computation for [{}] converged after [{}] and [{}] iterations, " | |
+ "[{}] compute() calls with [{}] total iterations since last convergence [{}] ago", | |
""" | |
Desired balance computation for [{}] converged after [{}] and [{}] iterations, \ | |
[{}] compute() calls with [{}] total iterations since last convergence [{}] ago""", |
Although I note that we use regular string concatenation in other places nearby already. Up to you.
...main/java/org/elasticsearch/cluster/routing/allocation/allocator/DesiredBalanceComputer.java
Outdated
Show resolved
Hide resolved
...main/java/org/elasticsearch/cluster/routing/allocation/allocator/DesiredBalanceComputer.java
Outdated
Show resolved
Hide resolved
"Desired balance computation for [{}] is still not converged after [{}] and [{}] iterations, " | ||
+ "[{}] compute() calls with [{}] total iterations since last convergence [{}] ago", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This message is user-visible and I think as worded here it might raise some support questions - what is compute()
for instance? Could we instead rephrase it so that the numbers in still not converged after [{}] and [{}] iterations
reflect the activity since the last convergence rather than the last interrupt? Then maybe say something like resumed computation [{}] times with [{}] iterations since the last resumption [{}] ago
to expose the numbers about the current computation. And maybe only do that if numComputeCallsSinceLastConverged > 1
so the message can be simpler when possible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored per your recommendation. I have an if/else here testing the number of computations, and also for the convergence message. There is some duplication going on in these two areas, but decided to leave as is. Please let me know what you think.
Add tracking of the number of compute() calls and total iterations between convergences in the DesiredBalanceComputer, along with the time since the last convergence. These are included in the log message when the computer doesn't converge. Closes elastic#100850.
dd5f442
to
ffdea84
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM great stuff
…iredBalanceComputer (elastic#126008) Add tracking of the number of compute() calls and total iterations between convergences in the DesiredBalanceComputer, along with the time since the last convergence. These are included in the log message when the computer doesn't converge. Closes elastic#100850.
Add tracking of the number of compute() calls and total iterations between convergences in the DesiredBalanceComputer, along with the time since the last convergence. These are included in the log message when the computer doesn't converge.
Closes #100850.